package com.ke.jun.view.widght

import android.content.Context
import android.graphics.*
import android.util.AttributeSet
import android.view.View

class DraTest @JvmOverloads constructor(context: Context,attributeSet: AttributeSet?=null,defStyleRes: Int=0)
    :View(context,attributeSet,defStyleRes){
    private var paint: Paint = Paint()

    init {
        paint.strokeWidth=5f
        paint.color=Color.RED
        paint.style=Paint.Style.STROKE
        paint.isAntiAlias=true
    }

    override fun onDraw(canvas: Canvas) {
        super.onDraw(canvas)
//        canvas?.drawCircle(100F, 100F, 100F,paint)
//
//        canvas?.drawRect(200F, 300F, 500F, 900F,paint)
//
//        canvas?.drawPoint(500F, 0f,paint)
//        paint.style=Paint.Style.FILL
//        canvas?.drawOval(200F, 300F, 500F, 900F,paint)
//
//        canvas.drawLine(300f,300f,500f,500f,paint)
//        canvas.drawLine(200f, 200f, 800f, 500f, paint)
//        val rect= RectF(100F,100F,500F,300F)
//        canvas.drawRect(rect,paint)
//        canvas.drawRoundRect(rect,50f,50f,paint)


        canvas.drawArc(0f,0f,800f,500f,-110f,100f,true,paint)
        canvas.drawArc(0f,0f,800f,500f,310f,100f,false,paint)
        paint.style=Paint.Style.FILL
        canvas.drawArc(200f,100f,800f,500f,110f,100f,true,paint)





    }
}